import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooLoginLogController } from '../../../controllers';
const uctoologinLogRouter = new Router();
const loginLogController = new uctooLoginLogController();

uctoologinLogRouter.post('/add', requireUser, loginLogController.add);
uctoologinLogRouter.post('/edit', requireUser, rowLevelPermission('uctoo/login_log'), loginLogController.edit);
uctoologinLogRouter.post('/del', requireUser, rowLevelPermission('uctoo/login_log'), loginLogController.delete);

//For getting loginLog with permission control
uctoologinLogRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/login_log'), loginLogController.getSingle);
uctoologinLogRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/login_log'), loginLogController.getMany);
uctoologinLogRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/login_log'), loginLogController.getMany);

//#endregion AutoCreateCode
uctoologinLogRouter.get('/serverlog', loginLogController.serverlog);
export default uctoologinLogRouter;
